import {defHttp} from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";

const { createConfirm } = useMessage();

enum Api {
  listCompositeCondition = '/TbBaseMeasuresTaskRecord/tbBaseMeasuresTaskRecord/listCompositeCondition',
  countForThisWeekTaskRecordByUsername = '/TbBaseMeasuresTaskRecord/tbBaseMeasuresTaskRecord/countForThisWeekTaskRecordByUsername',
  countDangerInvestigationByUsername = '/TbBaseDangerInvestigation/tbBaseDangerInvestigation/countDangerInvestigationByUsername',
  countForTimeFrame = '/TbBaseMeasuresTaskRecord/tbBaseMeasuresTaskRecord/countForTimeFrame',
  countForThisYearByMonth = '/TbBaseDangerInvestigation/tbBaseDangerInvestigation/countForThisYearByMonth',
  countForThisMonthTaskRecord = '/TbBaseMeasuresTaskRecord/tbBaseMeasuresTaskRecord/countForThisMonthTaskRecord'
}

/**
 * 查询个人本周风险排查任务数据
 * @param params
 */
export const queryCountForThisWeekTaskRecordByUsername = (username) =>  {
  return defHttp.get({url: Api.countForThisWeekTaskRecordByUsername, params:{ username }});
};

/**
 * 查询个人风险排查任务数据
 * @param params
 */
export const queryDangerInvestigationByUsername = (username,dangerState) =>  {
  return defHttp.get({url: Api.countDangerInvestigationByUsername, params:{ username,dangerState }});
};

/**
 * 本企业上周，今日，本周风险排查任务情况查询
 * @param params
 */
export const queryCountForTimeFrame= (nodeType) =>  {
  return defHttp.get({url: Api.countForTimeFrame, params:{ nodeType }});
};

/**
 * 列表接口
 * @param params
 */
export const baseMeasuresTaskRecordList = (params) =>
  defHttp.get({url: Api.listCompositeCondition, params});
  
/**
 * 查询本年月累计统计
 */
export const queryCountForThisYearByMonth = () =>  {
  return defHttp.get({url: Api.countForThisYearByMonth});
};

/**
 * 本月风险排查任务累计统计
 */
export const queryCountTaskRecordForThisMonth = () =>  {
  return defHttp.get({url: Api.countForThisMonthTaskRecord});
};

